Documentation of tables in CVCOA.





First let's get one thing straight. Location hierarchy:

Level --> Block --> Room --> "Screen Sized" Part of the room --> XY screen position

-------------------------------------------------------------------

DOORS

0x3ED0 : Doors assigned for each stage.
0x3EF0 : The Details assigned to each door when one enters.
0x1F69B: The actual locations of the doors in each level block.


For the 0x3ED0 table, each stage door in the game is represented by two bytes.
For example, the first door at 0x3ED0:

01 00

The first byte refers to the block in which the door is. The first nybble of 
this byte refers to the level, the second nybble refers to the block number 
in that level. NOTE: This means there can only be one door per block.

The second byte refers to which string of 4 bytes it is getting data from in 
the 0x3EF0 subtable. "00" here refers to the ver first one.


Information for each door in the subtable at 0x3EF0, as previously mentioned, 
is represented by 4 bytes. For example, the first one at 0x3EF0:

00 04 00 00

The first byte is the side of the screen which the door is one. ("00" for 
right, "01" for left).

The second byte is the level the player will go to on the other side.

The third byte is the block in that level the player will end up.

The fourth byte is which type of room the player will go to while getting to 
the other side (if it's "00", which it almost always is, it'll be a standard 
loading room; anything higher will probably be a portal room).



The physical location of each door in the game is defined by 6 bytes at a table 
starting at 0x1F69B. These six bytes refer to the following.

Byte 1- The room in the block it is in
Byte 2- The "screen sized" part of the room its in.
Byte 3- The side of the wall its on (01 for right side)
Byte 4- The Y position it is at on screen
Byte 5- The Y position an alternate door opens (this feature is likely useless now)
Byte 6- not sure


-------------------------------------------------------------------

ROOM CHANGES AND PLAYER STARTING POSITIONS


There are three separate tables that define player starting positions, 
based on three different conditions.

0x1338D: Pointer table for starting positions in stage blocks if the 
         player arrives in the level for the first time without changing 
         blocks.
0x134AB: Pointer table for starting positions in stage blocks if the 
         player arrived in the block after going off the right side of the 
         screen.
0x13E51: Pointer table for starting positions in stage blocks if the 
         player arrived in the block after going off the left side of the 
         screen.

Each pointer represents a level and there should be 15. They point to 
another subtable which has strings of data that define player location 
and XY map coordinates for when a player enters a block.

Each block in a level is represented by 4 bytes. For example, the definition 
of the position when the player starts at the beginning of the game at 
0x133AB (currently):

2C 00 FE FE

The first byte refers to the player's XY position on the screen. The first 
nybble is the X position, the second is the Y position.

The second byte defines which part of the block the player will appear in. 
The first nybble is which part of the room the player will appear in (eg, 
which of the "screen sized" sections of a room the player will appear in).
The second nybble is the room in which the player will appear in that 
block.

The third byte is the player's X map screen coordinate.

The fourth byte is the player's Y map screen coordinate.

-------------------------------------------------------------------

TELEPORT CHAMBERS



